use "C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\UpdatedAnalysis\energy_and_commerce_91_115_transformed"

/* This do file creates figure 2 and figures 3a and 3b for the manuscript describing oversight hearings by the House Energy and Commerce
Committee from 1969 to 2018.  */


#delimit ;

gen year=. ; replace year=1970 if congress==91; replace year=1972 if congress==92 ;  replace year=1974 if congress==93 ;
replace year=1976 if congress==94 ; replace year=1978 if congress==95 ; replace year=1980 if congress==96 ;
replace year=1982 if congress==97 ; replace year=1984 if congress==98 ; replace year=1986 if congress==99 ;
replace year=1988 if congress==100 ; replace year=1990 if congress==101 ; replace year=1992 if congress==102 ;
replace year=1994 if congress==103 ; replace year=1996 if congress==104 ; replace year=1998 if congress==105 ;
replace year=2000 if congress==106 ; replace year=2002 if congress==107 ; replace year=2004 if congress==108 ;
replace year=2006 if congress==109 ; replace year=2008 if congress==110 ; replace year=2010 if congress==111 ;
replace year=2012 if congress==112 ; replace year=2014 if congress==113 ; replace year=2016 if congress==114 ;
replace year=2018 if congress==115 ;

twoway

(line sum_days congress, xaxis(1) yaxis(1) lcolor(black))
(line sum_nagency year,lcolor(black) lpattern(dash) yaxis(2) xaxis(2)),

xtitle("Congressional Session",  height(5) axis(1) )
ytitle("No. of Non-Leg. Hearing Days", height(5) axis(1) )
xtitle("Second Year of Session",  height(5) axis(2)  )
ytitle("No. of Exec. Branch Personnel Testifying", height(5) axis(2) )

xlabel(91(2)115,angle(45) axis(1) labsize(vsmall))
ylabel(0(50)300, labsize(vsmall) angle(45) axis(1) )
xlabel(1970(4)2018,angle(45) axis(2) labsize(vsmall))
ylabel(0(150)600,angle(45) axis(2) labsize(vsmall))

title("Figure 2. House Energy and Commerce Non-Legislative Hearing Days", size(small) color(black))
subtitle("and No. of Exec. Branch Personnel Testifying, 91st to 115th Congresses",size(small))
legend(label(1 "Hearing Days") label(2 "Executive Witnesses") size(vsmall) height(8))
nodraw saving("C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure2") ;

replace pro_nagency=pro_nagency*100 ;

twoway

(line sum_nagency congress,lcolor(black) yaxis(1) xaxis(1))
(line pro_nagency  year,lcolor(black) lpattern(dash) yaxis(2) xaxis(2)),


xtitle("Congressional Session",height(5) axis(1))
ytitle("No. of Witnesses", height(7) axis(1))
xtitle("Second Year of Session", height(5) axis(2))
ytitle("Percentage", height(7) axis(2))

xlabel(91(2)115,angle(45) axis(1) labsize(vsmall))
ylabel(0(150)600,angle(45) axis(1) labsize(vsmall))
xlabel(1970(4)2018,angle(45) axis(2) labsize(vsmall))
ylabel(0(15)60,angle(45) axis(2) labsize(vsmall))

title("Figure 3a. Number, and Percentage, of Agency Witnesses,", size(small) color(black))
subtitle("91st to 115th Congresses",size(small))
legend(label(1 "No. Witnesses") label(2 "Pct.") size(small) height(8))
nodraw saving("C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure3a") ;


replace pro_zero=pro_zero*100;

twoway (line sum_zero congress,lcolor(black) yaxis(1) xaxis(1))
(line pro_zero year ,lcolor(black) lpattern(dash) yaxis(2) xaxis(2)),

xtitle("Congressional Session",height(5) axis(1))
xtitle("Second Year of Session", height(5) axis(2))
ytitle("No. of Zero Agency Witness Hearings", axis(1) height(7))
ytitle("Percentage", axis(2) height(7))

xlabel(91(2)115,angle(45) axis(1) labsize(vsmall)) xlabel(1970(4)2018,angle(45) axis(2) labsize(vsmall))
ylabel(0(25)100,axis(1) angle(45) labsize(vsmall)) ylabel(0(25)100,axis(2) angle(45) labsize(vsmall))

title("Figure 3b. The Number, and Percentage, of Oversight Hearings with", size(small) color(black))
subtitle("No Agency or EOP Witnesses, 91st to 115th Congresses",size(small))
legend(label(1 "Number") label(2 "Pct.") size(small) height(8))
nodraw saving("C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure3b") ;

graph combine "C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure3a"
"C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure3b",
nodraw saving("C:\Users\Jason MacDonald\Dropbox\Research\Oversight\Hearings\Data_for_Energy_and_Commerce\Testimony Manuscript\Revisions documents\Figure3a3b");

